Python scripts run in the background and python scripts run in the background
Problem description:
Environment: CentOS6.4
A monitoring script test1.py written in python is always running in the while True mode. Run the following command to start the script remotely (using th
Run commands in the background: and nohupcommand and disable and view background tasks
When we work on a terminal or console, we may not want to occupy the screen by running a job, because there may be more important things to do, such as reading emails. For intensive disk access processes, we want them to run during
Termination of background processes:
Method 1:
Run the jobs command to view the job number (assuming num), and then run kill % num
Method 2:
Run the ps command to view the job process ID (PID, assumed as pid), and then run the kill pid command.
Termination of the foreground
Problem Description: A program developed on a Linux server that interrupts the execution of a remote connection, but the running program shuts down automatically as a child of the terminal window. I want the program to run in the background of the terminal, and the program can still run after the terminal is closed.
(1) To enable the program in the
Fg, bg, jobs, amp;, nohup, ctrl + z Command 1, amp; at the end of a command, you can run this command in the background, for example, gftp amp;, 2. ctrl + z can put a command that is being executed on the foreground in the background and is in the paused state. it cannot be executed. 3. jobs can view the current status...
Fg, bg, jobs, , nohup, ctrl + z comman
there are multiple commands in the background, you can use fg % jobnumber (command number, not process number) to call up the selected command.
5. bg
Change a command that is paused in the background to continue execution in the background. If there are multiple commands in the background, you can use bg % jobnumber t
Run and close the CentOS background and view the background task commands
Fg, bg, jobs, , nohup, ctrl + z, ctrl + c command
I ,
At the end of a command, you can put the command in the background for execution, as shown in figure
Watch-n 10 sh test. sh # execute the test. sh script every 10 s in the background2. ct
For example, I need to decompress Or compress another 70 GB object. I can't always open a terminal. If I keep on a terminal, if the transfer is half done, I need to cut off the power or cut off the network, you are finished, so we can put her on the terminal to run: @ #: nohup your shell command example: nohup tar-zxvf/var/www/html.tar.gz this command will generate a nohup log Example 2: Check whether the work in the
] endBackgroundTask:self.backgroundTaskIdentifier]; Destroy background task identifier strongself.backgroundtaskidentifier = Uibackgroundtaskinvalid; } });} A long-running Task method for impersonation-(void) Timermethod: (Nstimer *) paramsender{//backgroundtimeremaining attribute contains the time that the program left for us Nstimeinterval backgroundtimeremaining =[[uiaPplication sharedapplication] backgroundtimeremaining]; if (backg
Tags: style color using OS io strong file 20142014-08-08 BaoxinjianI. Summary
The nohup command runs commands specified by the command parameter and any related arg parameters, ignoring all hang-up (SIGHUP) signals.Use the Nohup command to run a program in the background after logging off.To run the Nohup command in the
Wen YiI learned from the Apple documentation that the general application can get a certain amount of time to run the task in the background, that is, it can run in the background for a short period of time.There are also three kinds of types that can be run at the rear,1. M
Linux Command background runThere are two ways of doing this:1. Command : Background run, you shut down the terminal will stop running2. Nohup Command : Run in the background, you will continue to run the terminalFirst, Introducti
1. Add amp to the command after the order, and you can make the command work in the background, the greatest benefit is not afraid to be interrupted by the CTRL + C interrupt instruction. 2. Then you may ask again, how does the program in the background make it back to the foreground? It's simple, just use the FG command, and you can do it. 3. Some students may ask again, I have now
Reference textThere are two ways of doing this:1. Command : Background run, you shut down the terminal will stop running2. Nohup Command : Run in the background, you will continue to run the terminalFirst, IntroductionLinux/unix the biggest advantage of the Microsoft platfor
Linux Command background runTurn from the rain in the north, thank you: http://www.cnblogs.com/lwm-1988/archive/2011/08/20/2147299.htmlThere are two ways of doing this:1. Command : Background run, you shut down the terminal will stop running2. Nohup Command : Run in the background
method can reclaim the memory used by these pictures and music resources by setting the variables of these pictures and music resources to nil.When the app goes to the foreground again, the controller's Enterfore: method is called, and the method is responsible for loading the pictures and music resources again. Here is the code for the Enterfore: method.
Code Snippets
-(void) Enterfore: (nsnotification *) notification{NSLog (@ "===enterfore===");Bglayer1.contents = (ID) [Bgi
There are two ways of doing this:1. Command : Background run, you shut down the terminal will stop running2. Nohup Command : Run in the background, you will continue to run the terminalFirst, IntroductionLinux/unix the biggest advantage of the Microsoft platform is the real
1. Add amp to the command after the order, and you can make the command work in the background, the greatest benefit is not afraid to be interrupted by the CTRL + C interrupt instruction.2. Then you may ask again, how does the program in the background make it back to the foreground? It's simple, just use the FG command, and you can do it. 3. Some students may ask again, I have now
There are two ways of doing this:1. Command : Background run, you shut down the terminal will stop running2. Nohup Command : Run in the background, you will continue to run the terminalFirst, IntroductionLinux/unix the biggest advantage of the Microsoft platform is the real
There are two ways of doing this:1. Command : Background run, you shut down the terminal will stop running2. Nohup Command : Run in the background, you will continue to run the terminalFirst, IntroductionLinux/unix the biggest advantage of the Microsoft platform is the real
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.